import { getUserInfo } from "../api";

import tabRouter from "../router/page"
import Store from "../store/index"

async function UserInfo(){
    const res=await getUserInfo()
    const newTabRouter=tabRouter.filter(item=>{
        return res.data.authcodes.some(v=>v===item.mate.authcode)
    })
    Store.commit('CHANGE_ROUTER_LIST',newTabRouter)
    Store.commit('CHANGE_USER_INFO',res.data)
}

export {
    UserInfo
}